package com.waves.random;

import java.util.Arrays;
import java.util.Random;

public class TestRandom {
    public static void main(String[] args) {
        test01();
//        test02();
    }

    /**
     * random.nextInt(int bound)
     */
    public static void test01() {
        Random random = new Random();
        int origin = 100;
        int[] arr = new int[10];
        for (int i = 0; i < 10; i++) {
            arr[i] = origin + random.nextInt(100);
        }
        System.out.println(Arrays.toString(arr));  // [164, 146, 145, 181, 134, 179, 157, 163, 168, 130]
    }

    /**
     * random.ins(long streamSize, int randomNumberOrigin, int randomNumberBound)
     */
    public static void test02() {
        Random random = new Random();
        System.out.println(Arrays.toString(random.ints(10L, 100, 200).toArray()));  // [109, 120, 143, 140, 189, 196, 155, 186, 189, 196]
    }
}
